package com.wzu.group2.dao;



import com.wzu.group2.pojo.Perms;
import com.wzu.group2.pojo.Role;
import com.wzu.group2.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.security.PublicKey;
import java.util.List;

public interface UserMapper {
    public List<User> getUserList();
    public User findUserByNameAndPWD(@Param("userCode") String userCode,
                                     @Param("password") String password);
    public int addUser(User user);
    public User findUserById(Integer id);
    public User findUserByName(@Param("userCode") String userCode);
    public List<Integer> getUserRole();
//    根据用户名获取角色信息
    public User getUserRoleByName(String name);
    public int updateUser(User user);
    public int deleteUser(int id);
    public List<User> findUserByAdd(String name);
    //根据用户名查询所有角色
    User findRolesByUserName(String username);
    //根据角色id查询权限集合
    List<Perms> findPermsByRoleId(int id);
    List<User> find_all_ban();
    List<Perms> find_all_perm();
    public Perms find_permbyid(int id);
    public int permModify(Perms perms);
    public int add_perm(Perms perms);
    public int del_perm(int id);
    public int add_role_perm(int role_id,int perm_id);
    List<Role> find_all_role();
    public int addRole(Role role);
    public Role findRolebyId(int id);
    public int delRole(int id);
    public List<Integer> find_perms_id(int id);
    public int delRole_Perm(int role_id);
    public int add_user_role(int userId,int roleId);
    public List<Role> count_role();
    public Role find_rolebyUserId(int id);
    //更新用户角色表
    public int update_user_role(int userId,int roleId);
    public int del_perm_role(int id);
    //根据角色编码进行查询
    public Role find_rolebyCode(String roleCode);
}
